import auth from './auth'
import cache from './cache'
import modal from './modal'
import router from './router'
// 来自 ruoyi + elementplus 方法封装
import {resetForm} from '@/utils/ruoyi'
// 来自 lucy 的方法
import lucy from '@/utils/lucy'
export default function installPlugins(app){
  // 认证对象
  app.config.globalProperties.$auth = auth
  // 缓存对象
  app.config.globalProperties.$cache = cache
  // 模态框对象
  app.config.globalProperties.$modal = modal
  app.config.globalProperties.showToast = modal.showToast
  app.config.globalProperties.showModal = modal.showModal

  //表单
  app.config.globalProperties.resetForm = resetForm
  app.config.globalProperties.treeFilter = lucy.treeFilter
  // Store
  app.config.globalProperties.freeStore = lucy.freeStore

  // 路由
  app.config.globalProperties.navigateTo = router.navigateTo
  app.config.globalProperties.navigateBack = router.navigateBack
  // 本地缓存
  app.config.globalProperties.setStorage = cache.set
  app.config.globalProperties.setStorageSync = cache.setAsync
  app.config.globalProperties.getStorage = cache.get
  app.config.globalProperties.getStorageSync = cache.getAsync
  app.config.globalProperties.removeStorage = cache.remove
  app.config.globalProperties.removeStorageSync = cache.removeAsync
  app.config.globalProperties.clearStorage = cache.clear
  app.config.globalProperties.clearStorageSync = cache.clearAsync
  
}
